using System.Diagnostics;

namespace TTDotNet.Util
{
    public class GameTimer
    {
        Stopwatch stopwatch;

        public GameTimer()
        {
            stopwatch = new Stopwatch();
        }

        public void Start()
        {
            stopwatch.Start();
        }

        public void Stop()
        {
            stopwatch.Stop();
        }

        public void Reset()
        {
            stopwatch.Reset();
        }

        public long ElapsedMilliseconds
        {
            get { return stopwatch.ElapsedMilliseconds; }
        }

        public float ElapsedFraction
        {
            get { return (float)stopwatch.ElapsedTicks / (float)Stopwatch.Frequency; }
        }

    }
}
